package com.clusterswisdom.horn.api.tmall.action.itemcat;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.clusterswisdom.horn.api.tmall.TmallInstance;
import com.clusterswisdom.horn.api.tmall.action.AbstractTmallAction;
import com.taobao.api.response.ItemcatsGetResponse;

public class ItemcatsGetAction extends AbstractTmallAction implements HornAction {
	@Override
	public HornResponse execute(ApiConfig config, JSONObject param)
			throws Exception {
		ItemcatsGetResponse response=(ItemcatsGetResponse)TmallInstance.getInstance().executeRequest(param, "itemcat", "itemcatsGet");
		if (response.isSuccess()) {
			return new HornResponse(true,response.getItemCats());
			
		} else {
			return getUnsuccessResponse(response);
			
		}
	}
}
